package vno.fux.task
{
	public class TaskPage
	{
		private var _conditions:Array;
		private var _commands:Array;
		public function TaskPage()
		{
			_conditions = [];
			_commands = [];
		}

		public function get commands():Array
		{
			return _commands;
		}

		public function set commands(value:Array):void
		{
			_commands = value;
		}

		public function get conditions():Array
		{
			return _conditions;
		}

		public function set conditions(value:Array):void
		{
			_conditions = value;
		}

		public function meetCondition():Boolean
		{
			for each(var condition:String in _conditions)
			{
				var tmp:Array = condition.split(": ");
				var command:String = tmp[0];
				var params:String = tmp[1];
				var result:Boolean = ConditionInterpreter[command](params);
				if(!result) return false;
			}
			return true;
		}
	}
}